﻿CREATE Trigger [tr_Borrower_Phone]
On [dbo].[t_Borrower]
For Insert,UPDATE
As

IF @@ROWCOUNT = 0 RETURN
IF TRIGGER_NESTLEVEL(@@PROCID) > 1 RETURN

IF UPDATE(PhoneHome)
UPDATE a SET Phone = i.PhoneHome
FROM v_Address a INNER JOIN inserted i ON a.BorrowerID = i.ID
WHERE ISNULL(a.Phone,'') = ''


